package com.easylinkin.linkappapi.circuit.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.easylinkin.linkappapi.circuit.dto.RailCircuitGivealarmDTO;
import com.easylinkin.linkappapi.circuit.entity.RailCircuitGivealarm;
import com.easylinkin.linkappapi.circuit.vo.RailCircuitGivealarmVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface RailCircuitGivealarmMapper extends  BaseMapper<RailCircuitGivealarm>{

    @Select("SELECT COUNT(1) FROM rail_circuit_givealarm WHERE (device_code!='' AND  device_code IS not null ) AND tenant_id = #{tenantId} and give_type=#{giveType}")
    int countByTenantId(@Param("tenantId") String tenantId,@Param("giveType")String giveType);

    List<RailCircuitGivealarmVO> getList(@Param("entity") RailCircuitGivealarmDTO giveType);

    List<RailCircuitGivealarmVO> codeByNewRecords(@Param("tenantId") String tenantId, @Param("codes") List<String> codes);
}
